import req from './req';

export const login = options => {
  req('/user/login', {
    method: 'POST',
    noToken: true,
    ...options
  });
};

export const getUserInfo = options => {
  req('/user/info', options);
};

export const updateUserInfo = options => {
  req('/user/update/info', {
    method: 'POST',
    ...options
  });
};

export const sign = options => {
  req('/user/sign', options);
};

export const postForm = options => {
  req('/user/form', {
    method: 'POST',
    ...options
  });
};

export const getFriends = options => {
  req('/user/friends', options);
};

export const gameStart = options => {
  req('/user/game/start', options);
};

export const gamePoll = options => {
  req('/user/game/poll', {
    noLoading: true,
    ...options
  });
};

export const gameAnswer = options => {
  req('/user/game/answer', {
    method: 'POST',
    ...options
  });
};
